package com.zw.jdbc.dao;

import com.zw.jdbc.model.UserEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by zwz
 * date 2016/11/21
 * project com.zw.jdbc.dao
 */
@Repository
public class UserDao {

    @Autowired
    JdbcTemplate jdbcTemplate;

    public List<UserEntity> query(UserEntity userEntity) {
        String sql = "SELECT * FROM user";
        List list = jdbcTemplate.queryForList(sql);
        return list;
    }
}
